


<div class="bg-gray-100 ">
    <div class="mx-auto max-w-7xl  bg-no-repeat bg-opacity-70 bg-auto"
         style="background-image: url('/theme/images/banner.jpg')">
        <div class="bg-gray-100 bg-opacity-80">
            <div
                    class="flex flex-col justify-center items-center text-center bg-gradient-to-r from-gray-100 via-transparent to-gray-100"
                    style="height: 200px; ">
                <div class=" text-gray-900 text-2xl mb-4 font-bold">
                    {_'article'}
                </div>

                {* 位置导航 *}
                <div class="text-gray-500">
                    <div class=" flex flex-row gap-2">
                        <div>
                            <a href="/" class="hover:underline">{_'home'}</a>
                        </div>
                        <div>&rsaquo;&rsaquo;</div>
                        <div><a class="hover:underline" href="/page/article">{_'article'}</a></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="mx-auto max-w-7xl mt-10 px-4">



    {var $classList = \App\Content\Service\Category::query()->with(['descendants'])->whereNull('parent_id')->orderBy('id')->get()}
    {foreach $classList as $class}
    <div class="mt-8">
        <div class="flex py-6">
            <div class="flex-grow font-black text-lg">
                <a href="/page/article/{$class->id}"
                   class="hover:underline">{$class->name}</a>
                <span
                        class="ml-2 font-normal text-gray-300">{$class->subname}</span>
            </div>
            <div class="flex-none">
                <a href="" class="hover:underline">更多 →</a>
            </div>
        </div>

        <div class="grid lg:grid-cols-2 gap-6">
            {var $categories = [$class->id, ...$class->descendants()->pluck('id')]}
            {var $list = \App\Content\Service\Article::query()->whereIn('class_id', $categories)->limit(4)->orderByDesc('id')->get()}
            {foreach $list as $item}
                {include 'widgets/article-show.latte', item: $item}
            {/foreach}
        </div>
    </div>
    {/foreach}

</div>